/*
Copyright 2011 Francisco Nieto Raya

This program is free software: you can redistribute it and/or modify it under the terms of the Apache Software License 
as published by the Free Software Foundation, either version 2.0 of the License, or (at your option) any later version.

This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation.
For more information on the Apache Software Foundation, please see <http://www.apache.org/>.

*/

#ifndef _FUNCIONES_
   #define _FUNCIONES_
           #include "gd.h"
           typedef struct pixe{
                   int r,g,b;
                   }pixel;
           typedef struct image{
                   int fil,col;
                   pixel **pix;
                   }imagen;
           imagen* crearImg(int fil,int col);
           imagen* deImagePtr(gdImagePtr im);
           gdImagePtr abrirImagen(char *nfich);
           gdImagePtr deImagen(imagen *img);
           void conv_gris (gdImagePtr im,imagen *img);
           void escribirImagen(char*nfich,gdImagePtr im);
           void liberarImagen(imagen *img);
           void espjhorizont (imagen *img,int tamf,int tamc);
           imagen* zoom (imagen *img,int tamf,int tamc,int factor,int x1,int y1,int x2,int y2);
           void rellenar_imagen (int fil,int col,imagen *img);
           void dar_color (int fil,int col,imagen *img,int r,int v,int a);
           imagen* leerFichero(char *nfich);
           imagen* convolucion (imagen *img,imagen *img2);
           imagen* recorte (imagen* I,int col2,int fil2,int col,int fil);
           void normaliza (imagen* IMG);
           imagen* conv_img(int m[][]);
           imagen* umbral(imagen* I,double umb);
           imagen* gradiente(imagen* Iv,imagen* Ih);
           void tam (int *fil,int *col);
           void borrador(imagen* img);
           imagen* adaptador(imagen* I,imagen* img);
           void fusion (imagen*IMG,imagen*img);
   #endif
